package com.molin.IOtest.FileTest;

import java.io.File;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {

//        method1();
//        method2();
        method3();
    }

    public static void method3() {
        File file =new File("C:\\molin\\aaa\\bbb\\ccc\\ddd");

        boolean mkdir = file.mkdirs();
        System.out.println(mkdir);
    }


    public static void method2() {
        File file =new File("C:\\molin\\aaa\\bbb\\ccc");
        //无法递归创建目录，只能创建单级文件夹
        boolean mkdir = file.mkdir();
        System.out.println(mkdir);
    }

    public static void method1() throws IOException {
        File file=new File("C:\\molin\\a.txt");
        System.out.println(file.createNewFile());
    }
}
